Bill image generation

ABSTRACT

A method and apparatus for generating a bill image in a computer implemented billing system for a telecommunications network which includes providing a plurality of discounts for a customer retroactively applied to calls made during a billing period in which the discounts apply. The method includes loading qualification criteria for the plurality of discounts and customer account details into the billing system, generating a data structure defining a time line over at least part of which the discounts are operative, the time line being divided in dependence on the qualification criteria and customer account details into a number of segments each of which corresponds to a period during which a respective version of the discounts were operative, accumulating charges for the calls made during each segment, and calculating the appropriate discounts from the accumulated charges for each segment for calls which qualify for the discounts.

FIELD OF THE INVENTION

The present invention relates to a method of generating a bill image andalso to a computer-implemented billing system.

BACKGROUND TO THE INVENTION

As telecommunications technologies advance, the number of service typesavailable to the customer from telecommunications suppliers isincreasing dramatically. A private customer may have a standardtelephone line, a cardphone account and possibly access to networkfacilities such as call minding and 3-way calling, all of which may haveto be billed to a single account. A business customer may have many moreservices such as ISDN, permanent leased data connections, or multiplelines connected to a single number. Each service type to be chargedneeds to be clearly and logically laid out on the printed bill so thatthe customer can easily determine what he is being charged for.

With the deregulation of the telecommunications industry and subsequentcompetition it has brought a large number of charging systems,discounting options and other offers to attract customers and competewith other telecommunications suppliers has introduced the need forfurther levels of detail in bills so the customer can readily appreciatethe savings made.

A number of different discounting products or schemes may need to besupported. These may be introduced as promotions to all or selectedcustomers, sold as a product to a customer or subject to the customerrequesting to join the scheme. Examples of discounting products marketedby British Telecommunications public limited company include discountedSaturday calls, PremierLine and Friends & Family. A further discountingproduct offered, particularly to business users, is volume thresholddiscounting.

Typically, one of the problems in introducing new discounting productsor changes to a discounting product is the time taken to implementappropriate changes to the computer software used to process customerusage records to determine whether they are eligible for a discount andthen to determine the discount. A new discounting product to be offered,an alteration to the discount rate or eligibility criteria, or any othersimilar amendment requires program code to be updated or otherwiserewritten, sometimes at great expense. It is desirable to provide a billprocessing system that provides a more flexible discounting system.

EP-A-809387 discloses a system for rating and billing telecommunicationstransactions in real-time. A so-called real-time analysis engine (RAE)updates customers' bills in real-time by applying customer specific data(e.g. discount schemes) to automatic message accounting (AMA) records.An AMA record is generated for a call by a telecommunications switch andthe record is passed to the RAE where the call is rated. The RAE thenmatches the rated call to the customer who initiated the call, locatesthe customer's billing data, and applies to the call any discounts towhich the customer is entitled. After the call has been rated anddiscounted, or “priced”, it can be added to the customer's other pricedcalls for the current billing period to generate a current bill for thecustomer. The RAE may also adjust charges for old calls to reflectcertain types of billing plans. For example, a customer may receive aconditional 10% discount on all calls within a billing period providedthat the customer exceeds $100 in total charges within the billingperiod. In such a case, calls will initially be billed at the full rate,until such time as the total charges reach $100. Thus, if the customer'scharges do reach $100 before the end of the billing period, not onlywill subsequent calls need to be discounted by 10%, but all previouscalls will need to be discounted by 10%. This is the only example ofretrospective discounting, the specification otherwise being solelyconcerned with real-time pricing. There is no disclosure of accumulatingcharges by time segments and calculating appropriate discounts from theaccumulated charge segments.

WO-A-9849825 describes a method of processing “call detailed records”(CDRs) which are used in the generation of bills. In the method, agraphical user interface is used to enable a user to select the datafields which are to be used to provide the data from which a bill is tobe produced. Only such data as corresponds to the fields which have beenselected will pass from the home telephone exchange to the billingcentre. There is no reference to charge type identifiers, nor to theediting of bill images. Rather, the invention seems to be addressingproblems of excess data (including blank fields) in a variety of formatsbeing passed between telephone exchanges and billing centres;difficulties of adding or removing fields from CDRs; and the need forthe suppliers of telephone exchange equipment to be notified as much asa year before installation of a telephone exchange of the format/fieldnames, etc. which are to be used in the CDRs. Thus can be seen that theinvention there set out is addressing a very different problem from theone addressed by the present invention.

In the paper “A graphical tool for bill design”, BT Technology Journal,Vol 12, No 4. pp 85-91, 1994, Utton and Saunders, there is described atool to support the design of telephone bills. The tool allows a billdesigner to modify the layout of a bill graphically, using a graphicaluser interface, and to receive feedback from a knowledge base embodyingtypographical guidelines and operational system constraints. In thisway, the tool is able provide decision support for the bill designprocess. The tool is also able to generate the formating parametersrequires by the operational systems to implement revised bill designs.

Using the graphical user interface, a designer is able to edit an imageof a bill. There is, however, no discussion of discounting schemes norof how they might affect bill generation.

The paper “Multiservice billing system—a platform for the future”, BTTechnology Journal, Vol 14, No 3, pp 98-113, J Crookes gives anextensive overview of the complexities inherent in billing systems for amajor telecommunications provider. It does not discuss the influence ofdiscounting schemes on bill generation.

SUMMARY OF THE INVENTION

According to a first aspect of the present invention, a method ofgenerating a bill image for a customer in a computer implemented billingsystem for a telecommunication network which includes discounts for acustomer applied to calls during a billing period in which a pluralityof discount schemes apply, include the steps of loading qualificationcriteria for the discount schemes and customer account details into thebilling system, characterised in that the method further includesgeneration a data structure for each discount scheme, the datastructures defining a time line over at least part of which the discountscheme was operative, the time line being divided in dependence onsubscription to the discount scheme by the by customer and on changes tothe discount scheme during the billing period into a number of segmentseach of which corresponds to a period during which a respective versionof the discount scheme was operative, accumulating charges for the callsmade during each segment, and subsequently calculating an appropriatediscount from the accumulated charges for each segment for calls whichqualify for a discount under the discount scheme.

Preferably, the step or accumulating the charges for the calls madeduring each segment includes accumulating the charges for calls made ineach of a number of predetermined categories.

Preferably, the step of calculating the appropriate discount includesobtaining an appropriate discount rate associated with the respectiveversion of the discount scheme for the predetermined category for whichthe charges have been accumulated and applying the discount rate to theaccumulated charges.

Preferably, the step of generating the time line further includes thesteps of determining date of the earliest made call of the calls madeand, if the date falls before the start of the billing period, extendingthe billing period to include the date of the call.

Preferably, the method further includes the step of generating adiscount usage record containing the calculated discount for use in thegeneration of the bill image.

According to a second aspect of the present invention, a computerimplemented billing system includes at least one computer readablememory storing computer executable instructions for performing themethod of the first aspect of the present invention.

According to a third aspect of the present invention, a computerimplemented billing system is arranged to perform the followingoperations to generate a bill image which includes discounts for acustomer applied to calls made during a billing period in which aplurality of discount schemes apply: generate a data structure for eachdiscount scheme defining a time line over at least part of which thediscount scheme was operative, the time line being divided in dependenceon subscription to the discount scheme by the customer and on changes tothe scheme during the billing period into a number of segments each ofwhich corresponds to a period during which a respective version of thediscount scheme was operative, accumulate charges for the calls madeduring each segment, and calculate an appropriate discount from theaccumulated charges for each segment for calls which qualify for adiscount under the discount scheme. In the present invention, in orderto allow discounting products be applicable for part of a billingperiod, discounting products subscribed to by the customer and the dateson which they were active during the billing period are stored in acustomer account database. The data in the customer account database isused to generate a line for each discounting product, the time lineconsisting of one or more segments. Each segment on the time linerepresents a period in which the discounting product was active andunchanged. Each segment is associated with a number of accumulators forstoring of charges of usage records that qualify for the discountingproduct during the time period of the segment. The date of each usagerecord is compared with the time line data structure and if the datecoincides with the period of one of the segments, the charge held in theusage record is added to the accumulator linked to that segment. Onceall the usage records have been processed, discounts are calculated byobtaining the call types that qualify for the discount product and applythe correct discount rate to the sum stored in each accumulator ofqualifying call types. For each discount calculated, a discount recordis generated in which the discount and any other details necessary todisplay to the customer on their bill are stored.

The preferred example, hidden records relating to the discounting systemare added to the electronic bill image which contain the data used togenerate the products respective time line and a record for each productcontaining a copy of each segment and linked accumulators. This permitsbill image to be subsequently disassembled and edited to correct anymistakes.

BRIEF DESCRIPTION OF THE DRAWINGS

Examples of the present invention will now be described in detail withreference to the accompanying drawings, in which:

FIG. 1 is a functional block diagram of an example of an exchangeforming part of a telecommunications network and bill generation systemin accordance with the present invention;

FIG. 2 is a tree showing the processing flow of the bill generationsystem of FIG. 1;

FIG. 3 is the tree of FIG. 2 highlighting processes of the billgeneration system specific to the assembly of a bill;

FIG. 4 is a portion of a text map used in the bill generation system inaccordance with the present invention;

FIGS. 5a to 5 e illustrate the steps in generating a bill image from aset of usage records using the text map of FIG. 4;

FIG. 6 is a flow chart showing the processes of the bill generationsystem specific to applying discounts and the like;

FIGS. 7a and b illustrate time lines generated for applying discounts tousage records;

FIG. 8 is a flow chart of processes performed in disassembling andediting an existing bill image in accordance with the present invention;and,

FIG. 9 is the tree of FIG. 2 highlighting processes of the billgeneration system used in reassembling bill images.

DETAILED DESCRIPTION

In a telecommunications network, a service provider normally bills itscustomers on a regular monthly or quarterly basis. In the system shownin FIG. 1, for each call or use of a chargeable service made by acustomer a usage record is produced in a telecommunications exchange 10.The usage records are transmitted, in batches, to a pricing system 20.Each usage record is priced according to the provider's current scale ofcharges and stored in a data store 30 in a file associated with thecustomer. At a predetermined billing date, the contents of thecustomer's file in the database 30 are processed by a bill processingsystem 40. The billing system processes each usage record in sequence todetermine which service type it relates to, for example long distance,chargecard calls or operator services, and the records are then sortedinto groups according to service type and fed into a bill generator 60.

The bill generator outputs each group of sorted records and anynecessary headers and footers for that service as an electronic billimage 50. The bill generator 60 has an ordered list of service typeswhich corresponds to the order into which the records are pre-grouped.Each element in the list is associated with text headers and footersthat will appear on the printed bill. For each group of sorted records,the bill generator 60 compares the service type of the records to thatwhich it is expecting in its list. If these match then the associatedheaders and footers are outputted. Otherwise the bill generator 60 movesonto the next service in its list.

In order to accommodate variable charging, discounting and other suchoffers, the system shown in FIG. 1 is arranged so that in addition tosorting the usage records according to service type, they are alsoprocessed by a discounting engine 70 which sorts the usage records intogroups according to service type and also according to whether theyqualify for discounts. A discount is calculated from those records thatqualify which is then applied to the charge produced by the billprocessing system 40.

In FIG. 1, the pricing system 20 may be implemented by one computer,whilst the bill processing system 40, bill generator 60, and thediscounting engine 70 may be implemented by another computer. Eachcomputer is of a well known construction and comprises a centralprocessing unit, a store in the form of a random access memory, a readonly memory and a hard disk, a visual display unit, a keyboard and inputand output ports. The programs for controlling the operation of thecomputer are held in the store.

FIG. 2 is a tree showing an example of the information processing flowof a bill generation system in accordance with the present invention.The tree should be read from top to bottom and left to right. Anasterisk (*) in a block indicates that the process of the block isrepeated a number of times.

In the same manner as the system described above with reference to FIG.1, each call or use of a chargeable service made by a customer generatesa usage record which is priced and stored in a data store in a fileassociated with the customer. At the predetermined billing date, thebill generation system is run. Initialisation processes 100 and 110 areperformed to respectively initialise discounting modules of the systemand load from an external database a series of data processing rules andtables used by the system.

In process 120, an account processor prepares a bill for each customerto be billed on that date. In process 130, a number of time lines arecreated for use in determining any discounts from discounting productswhich are applicable to the customer over the period to be billed. Anumber of accumulators are also created and associated with the timelines for summing charges for subsequent use in calculating discounts.Each accumulator may relate to a chargeable service type such asdirect-dialled calls. For each customer installation the records storedin the data store 30 associated with the customer are processed firstlyby customer telephone line and then by usage record in process 140. Foreach usage record, billing details are assembled and stored in process150 by assigning a charge type identifier (CTI) to the usage record inprocess 160. As part of the bill assembly, a running total of chargesfor those records processed is kept in process 170, in addition toaccumulating the charges in the accumulators created in process 130. Asort key is assigned to the usage record which is then stored in anunsorted bill details (UBD) database in process 180.

A discounting engine processes the filled accumulators in process 190 todetermine, according to the discounting products initialised in process130, whether any discounts should be given. Each discounting productapplicable to the customer may generate one or more discount recordswhich are also passed to processes 150 to 180 to have a CTI and sort keyassigned and to be added to the UBD.

Once all the usage records have been processed and applicable discountshave been determined, the bill assembly control process 200 is called.This produces a bill summary according to the summed call charges lessany applicable discounts in process 210. In process 220 the UBD aresorted using the assigned sort keys to produce a list of sorted billdetails which is stored in a sorted bill details (SBD) database. The SBDis then passed to a bill generator 60 which parses the SBD and generatesan electronic bill image containing the records of the SBD and any otherappropriate information that should appear on the bill. A bill image isa representation of a bill and is stored in a database from which thebill can be printed. For each subset of records of the SBD, such asinternational direct dialled calls, a breakdown listing and/or a totalcharge in addition to explanatory text in the form of headers and/orfooters for that subset is produced by processes 230 and 250 and addedto the bill image in the appropriate position. The bill summarygenerated by process 210 is added to the bill image in process 260.Finally, a number of hidden records are added to the bill image byprocesses 270 and 280 enabling a user of the system to regeneratediscounting time lines, accounting details and other data specific tothe customer at the date the bill image was created without reference toany other data. Process 300 then prints the bill image to be sent out tothe customer.

FIG. 3 is the tree of FIG. 2 highlighting processes of the billgeneration system specific to the assembly of a bill.

An example of a group of usage records which are passed to process 150is shown below (the name of the fields are shown for clarity):

COST DATE TIME MAINLINE- OF DEST OF OF CALL ID Descriptor CALL NO. CALLCALL LENGTH NET-SV-ID 01232123456 DD local call  1.352 012322014319980101 120000 01132300 0123294364 01232123456 DD local call  0.4000123221123 19980101 120500 00014300 0123294364 01232223456 DD local call 0.199 0123221123 19980102 120500 00020000 0123294364 01232123456 DDlocal call  1.352 0123220143 19980102 120000 01132300 012329436401232123456 DD local call  0.400 0123221123 19980102 120500 000143000123294364 01232123456 DD local call  1.352 0123220143 19980101 12000001132300 0123294365 01232123456 DD local call  1.352 0123220143 19980102120000 01132300 0123294365 01232123456 DD local call  0.400 012322112319980102 120500 00014300 0123294365 01232123456 DD regional call  1.3520176271122 19980101 120000 01132300 0123294364 01232123456 DDinternational call  0.500 03993234234 19980101 120000 001133000123294364 01232123456 DD local call  0.400 0123221123 19980101 12050000014300 0123294365 01232123456 DD international call  1.052 0421212473219980101 120500 01132300 0123294364 01232223456 DD local call  0.160123220143 19980101 120000 00025900 0123294364 01232223456 DD local call 1.065 0123221123 19980101 120500 00015600 0123294364 01232123456 DDregional call  0.300 012471982 19980101 120500 00014300 012329436401232223456 DD local call 16.06 0123220143 19980102 120000 000200000123294364

The MAINLINE-ID field contains the telephone line number to which thecall should be assigned for charging whilst the NET-SV-ID contains thenumber from which the call was made. The abbreviation DD stands for“direct dialled”.

A set of rules loaded in process 110 from the external database are usedin process 160 to determine which of the set of CTIs should be assignedto each respective usage record. The rules associate the usage recordswith CTIs such that an assigned CTI uniquely identifies the type of theusage record. Some examples of CTIs are shown below:

Charge type CTI Friends & Family service charge 34 Direct dialled localcall itemised 35 Direct dialled regional call itemised 36 Direct diallednational call itemised 37 Direct dialled international call itemised 38Direct dialled other call itemised 39 Call diversion local facility fee46 Ring back when free national facility fee 56 Call diversion-localcall 71 Ring back when free - national 83 Operator call local 102 Operator call international 104  Chargecard call international 105 Chargecard call local 106  Chargecard call national 107 

Each usage record is processed in turn using data from, in particular,the DEST No (number called) field and NET-SV-ID field. Non-telephonecall usage records are processed using other fields (not shown in theabove example). Starting at rule 1 below, the type of charge isidentified using the Descriptor field of the record. For each permittedanswer, there is an associated output from the rule. The output consistsof an element of a charge identifier and a next action in the form ofthe next rule to be parsed or a command to exit as processing has eitherbeen completed or an exception has been raised. In parsing the rules forthe first record shown above, rule 1 determines that the record relatesto a direct dialled call and outputs a 1 before proceeding to parse rule2. It is determined that the call was not made using a cardphone and a 2is output and rule 3 is parsed. According to the customer's requirementsand default system settings, this type of charge may be bulked, that isindividually itemised on the customer's bill, and a 2 is output,continuing on to parse rule 4. Again, customer requirements and defaultsettings indicate that itemisation may be required for this type ofcharge and a 1 is output and rule 5 is parsed. Comparing the contents ofthe COST OF CALL field to the itemisation threshold stored in a databaseassociated with the customer, it is determined that the cost of the callis greater than the threshold and a 1 is output, proceeding to parserule 6. It is determined that the charge does not relate to aninternational call, a 2 is output and rule 7 is parsed. In rule 7, thecall distance is determined to be local, a 1 is output and the systemexits parsing for this record.

Rule Permitted Answers Output from Rule  (1) What type of call is itDirect dialled 1 - go to rule 2 Network Service (NS) 2 - go to rule 8facility fee NS call 3 - go to rule 8 NS fee non-call 4 - go to rule 11Other STOP BILL RUN  (2) Is this a cardphone call Cardphone 1 - go torule 3 Other 2 - go to rule 3  (3) Is bulking required No 1 - go to rule6 Possibly 2 - go to rule 4  (4) Is itemisation required Possibly 1 - goto rule 5 No 2 - go to rule 6  (5) Is the call cost greater Yes 3 - goto rule 6 than the itemisation threshold No 2 - go to rule 6  (6) Isthis an international Yes 1 - go to exit call Other 2 - go to rule 7 (7) What is the call distance Local 1 - go to exit Regional 2 - go toexit National 3 - go to exit Other 4 - go to exit  (8) Is this aninternational Yes 1 - go to rule 10 call Other 2 - go to rule 9  (9)What is the call distance Local 1 - go to rule 10 Regional 2 - go torule 10 National 3 - go to rule 10 Other 4 - go to rule 10 (10) What isthe network Charge advice 1 - go to exit service type Call diversion 2 -go to exit 3 way call 3 - go to exit Ring back when free 4 - go to exit5 - go to exit (11) What is the network Call return 1 - go to exitservice type Call trace 2 - go to exit Reminder call 3 - go to exit Calldiversion 4 - go to exit Ring back when free 5 - go to exit Other 6 - goto exit

In the above example, the value 1221121 is output from the rule parsing.This is cross referenced with the table below to give a CTI of 35.

Charge type Output from rules CTI DD local calls itemised 12121 00351221121 DD regional calls itemised 12122 0036 1221122 DD national callsitemised 12123 0037 1221123 DD international calls itemised 1211 0038122111 DD other calls itemised 12124 0039 1221124 Call diversion calllocal facility fee 2212 0046 Call diversion call national facility fee2232 0056 Call diversion call local 3212 0071 Ring back when free callnational 3234 0083

As each usage record is processed in process 170 the total charge to thecustomer is accumulated.

In process 180, a sort key for each usage record is generated accordingto the following criteria:

sort section key—overall ordering within the bill based on the record'sCTI

mainline key—the telephone number to be processed

sort subsection key—ordering within a subsection of a bill based on therecord's CTI

calling line ID—the telephone number from which the call was made

call date—the date on which the call was made

call time—the time at which the call was made

These criteria form part of the rules loaded in process 110.

For example, the above usage records would be respectively assigned thefollowing sort keys:

(sort section | main line | sort subs | calling line | date | time) 3 |01232123456 | 18 | 0123294364 | 19980101 | 1200 3 | 01232123456 | 18 |0123294364 | 19980101 | 1205 3 | 01232123456 | 18 | 0123294364 |19980102 | 1200 3 | 01232223456 | 18 | 0123294364 | 19980102 | 1205 3 |01232123456 | 18 | 0123294364 | 19980102 | 1205 3 | 01232123456 | 18 |0123294365 | 19980101 | 1200 3 | 01232123456 | 18 | 0123294365 |19980101 | 1205 3 | 01232123456 | 18 | 0123294365 | 19980102 | 1205 3 |01232123456 | 20 | 0123294364 | 19980101 | 1200 3 | 01232123456 | 22 |0123294364 | 19980101 | 1200 3 | 01232123456 | 18 | 0123294365 |19980102 | 1200 3 | 01232123456 | 22 | 0123294364 | 19980101 | 1205 3 |01232223546 | 18 | 0123294364 | 19980101 | 1200 3 | 01232223456 | 18 |0123294364 | 19980101 | 1205 3 | 01232123456 | 20 | 0123294364 |19980101 | 1205 3 | 01232223456 | 18 | 0123294364 | 19980102 | 1200

Each usage record and its assigned CTI and sort key is stored in theUBD. Some usage records, for example for chargecard calls, may take muchlonger to reach the service provider than those for a local call andcould therefore be out of time order sequence. The usage record may evenbe from a previous billing period.

Process 210 generates a bill summary for the customer. The summarycontains the customer account number and address for billing as well asthe total charges accumulated in process 170 less any applicablediscounts.

In process 220 the UBD are sorted numerically by the assigned sort keysto produce a sorted bill details (SBD) which are stored in a SBDdatabase. The SBD are parsed in processes 230 and 250 to generate anelectronic bill image containing the records to be printed from the SBD,formatting codes relating to how lines of the bill should be printed andtext codes indicating other information that should appear on the bill.These processes are described in more detail with reference to FIG. 4.Process 260 takes the bill summary produced in process 210 and adds itto the electronic bill image.

Processes 270 and 280 add the records from the SBD and other customerdata to the electronic bill image that, whilst not printed on the bill,would be needed for reference in determining how the bill was generatedor when amending the bill. Non-itemised usage records are assigned adifferent CTI to itemised usage records which results in them not beingindividually displayed on the bill. Process 270 passes each hiddenrecord of the SBD to process 280 which adds it to the electronic billimage on a hidden page which is not printed by process 300. Other typesof hidden records added here are discussed in further detail withreference to FIG. 6.

The electronic bill image is then passed to process 300 for printing anddispatch to the customer.

Process 300 reads each line of the bill image and, using data tablesloaded in process 110, converts the records and codes into lines offormatted text and places it into a print file. The data tables containdetails on the font, text size and format of a line according to itsCTI. The data tables also contain cross references from text codes totextual description lines to be added to, around, before, or after abill image line.

For example, a bill image record may be of the form:

CTI 34|£2.00|TextCode00123

Process 300 retrieves the text relating to code 00123 (“You have chosento opt for Friends & Family and you will be charged <VAL> per month”),the format relating to CTI 34 (Times New Roman 10 italics bold) andoutput the following to the print file:

You have chosen to opt for Friends & Family and you will be charged£2.00 per month

The entries in the data tables for hidden records, the hidden attributebeing specified by their respective CTI, instruct process 300 to ignorethese records. Once each line of the bill image has been processed, theprint file is sent to a printer to be output. An example of a print fileto be output is shown below:

Regional & national calls Regional & national calls over 0.50 (itemised)Cost Duration before Desti- Number (hrs:mins:- discount Date Time nationof calls secs) () Line number 894100  3 Nov 10:30 Ipswich 01473 32014301:13:23  1.352 10 Nov 11:36 Ipswich 01473 321123 !SA- 00:01:43  0.563VER!! Subtotal for line 894100 01:15:06  1.915 Line number 894425 11 Nov10:30 Ipswich 01473 320143 01:13:23  1.352 Subtotal for line 89442501:13:23  1.352 Total regional & national calls 02:28:29  3.267 over0.50 (itemised) Total regional & national calls 152 03:01:59 18.968

International calls International calls over 0.50 (itemised) CostDuration before Desti- Number (hrs:mins:- discount Date Time nation ofcalls secs) () Line number 894100  3 Nov 10:30 France 33345434436 !SA-00:06:23  1.352 VER!!  3 Nov 11:36 USA 12124523445 USA- 00:03:43 0.563PLAN Subtotal for line 894100 00:10:06 1.915 Line number 894425 11 Nov10:30 France 33342320143 01:13:23 1.352 16 Nov 11:36 USA 13122346532!SA- 00:01:43 0.563 VER!! Subtotal for line 894425 01:15:06 1.915 Totalinternational calls 01:25:12 3.830 over 0.50 (itemised)

FIG. 4 depicts a portion of a tree of a text map used in the generationand formatting of an electronic bill image. The tree defines therelationships between sections of the bill, such that each node of thetree represents a section. The hierarchy of the tree is such that lowerlevel nodes represent subsections of higher level nodes. Each CTI ismapped to a leaf node in the tree. CTI mappings shown in FIG. 4 areexpressed in the form CTI-XXX, where XXX is the CTI number.

The following structure is populated for each usage record processed:

CURRENT USAGE RECORD

CTI

HEADING ARRAY

CURRENT SECTION ID

TRIGGER VARIABLES ARRAY

For each usage record, its immediate heading is obtained by followingthe mapping of the usage record's assigned CTI to a leaf node whichdefines the heading for that CTI type. The identifier of that heading iswritten to the first element of the heading array. From this leaf node,the heading identifier of the parent section is obtained by followingthe branch of the leaf node up one level in the tree. This is stored inthe second element of the array, and so on up the tree until the root isreached.

In one example, an SBD having usage records with respective CTIs of 35,35, 37 and 56 is passed to process 250. CTI 35 is mapped to leaf 412 inthe tree. Following the branch up the tree and recording the identifiersof each node passed, the first and second records generate a headingbranch array of [400 410 411 412 ]. In a similar manner, the thirdrecord generates a heading branch array of [400 410 414 415] and thelast record generates a heading branch array of [400 430 435 436].

For each CTI, one or more trigger variables may also be stored, eachvariable can trigger the output of a section header at any one of theheading identifiers in the heading array structure. A change of value oftrigger variable causes new section information to be written to theelectronic bill image for that section. A trigger variable may be, forexample, a change in the telephone line to be displayed. If a bill is tobe generated for 2 or more telephone lines, each may have usage recordsfor direct dialled local calls (each record will have the same CTI) andthese may be outputted to the bill image in the same section. However,the CTI for direct dialled local calls may have a trigger variable ofchange in line, in which case when the line identifier changes, a headerand possibly a footer may be outputted to the current section of theelectronic bill image to differentiate between charges from thedifferent lines. Trigger variables are obtained from a trigger tableloaded by the system in process 110 and stored in the trigger variablearray.

Once the arrays have been determined, process 250 determines whether anyheader or footer information in the form of text codes need to beoutput. Firstly, the heading identifier for the first entry in each ofthe current and previous charge structures is compared. If these valuesare the same, the corresponding trigger variables stored against thoseheading identifiers are compared. This is repeated for each headingidentifier value and trigger variable until a change is noticed, atwhich point the level of change is recorded. If no change occurs, thenno change in header information is required and the usage record can beoutput to the bill image directly.

Once a change is detected at a certain heading level, the footersbelonging to the previous charge down to and including the change pointgiven by the previous section are output to the bill. This is thenfollowed by the headers belonging to the current charge up from andincluding the changed level.

An example of the processing of the above arrays for generating anelectronic bill image is illustrated schematically in FIGS. 5a to 5 e.

The electronic bill image illustrated in FIG. 5a is generated byprocessing the first record and its corresponding array. Headers openingrespective sections 400, 410, 411 and 412 are output, followed by thefirst record 550. As the array of the first and second records do notdiffer, on processing the second record and its array, only the secondrecord 560 is output to the electronic bill image as is illustrated inFIG. 5b.

In processing the third record, its corresponding array differs at thethird and fourth element [400 410 414 415 ]. This difference causessections 411 and 412 to be closed by outputting footers before headersopening respective sections 414 and 415 are output. The third record 570is then output to the electronic bill image, as illustrated in FIG. 5c.

The array corresponding to the last record differs from the previousrecord at the second element [400 430 435 436 ]. This difference causessections 410, 414 and 415 to be closed by outputting footers prior toheaders opening respective sections 430, 435 and 436 being output. Thelast record 580 is then output to the electronic bill image, asillustrated in FIG. 5d. As there are no more records to process, theremaining open sections 400, 430, 435 and 436 are closed by outputtingfooters completing generation of the bill image, as illustrated in FIG.5e.

In the above process, the heading arrays need not be generated all atonce and could be generated one at a time as the electronic bill imageis being created as long as a copy of the previous header array wasretained for use in determining differences in heading sections.

In the example described above the term “usage record” is applied tocall records. However, the invention may be applied to other forms ofusage records relevant to, for example, discounting products (seebelow), and rental charges for equipment or other facilities.

FIG. 6 is a flow chart in which processes 100, 130, 170 and 190 of thebill generation system specific to applying discounts and the like aredescribed in further detail.

Each discounting product will have one or more qualification criteriadefined. For example, for PremierLine provided by BritishTelecommunications plc most call charges qualify for a discount (chargesfor calls to mobile telephones or premium rate numbers are normallyexcluded), whilst for Friends & Family provided by BritishTelecommunications plc, only call charges on calls to a group ofselected numbers qualify for a discount. The qualification criteria foreach discounting product are loaded into the system in step 600 from anexternal data store (process 100). A CTI to call type mapping is alsoloaded from an external data store in step 600.

In order to allow discounting products to be applicable for only a partof a billing period, discounting products subscribed to by the customerand the dates on which they were active during the billing period arestored in a customer account database.

When first starting to process a customers account, the customer accountdatabase is accessed and the discounting products subscribed to, and thedates on which they were active for the customer, are obtained in step610 (process 130).

If a customer is a member of Friends & Family, the customer's selectedset of numbers are obtained from the customer account database and areadded to the qualification criteria for the Friends & Family discountingproduct.

Using the data from the customer account database, a time line for eachdiscounting product subscribed to is generated in step 600. A timelineconsists of one or more segments, each segment representing a period inwhich the discounting product was active and unchanged, i.e. thediscount rate or circumstances in which discounts apply do not change.Each segment has a number of accumulators for storing charges of usagerecords that qualify for the discounting product during the time periodof the segment.

The structure of each segment of a time line is dependent on thediscounting product. For Friends & Family, each segment has anaccumulator for each number from the customer's selected group, whilstfor the other products each segment has a number of accumulators, onefor each of a fixed number of call types, in which details of anyqualifying usage record for that segment are stored. The accumulatorsare created in process 130, as previously discussed with reference toFIG. 2.

FIG. 7a illustrates an example of a time line generated for adiscounting product in which a customer subscribes to the product partway through a billing period and a number of changes to the product arealso made. Prior to obtaining data on the discounting product, the datesof the usage records in the UBD are checked to determine whether anyrecord is from a previous billing period. If so, the billing period, forthe purposes of generating time lines is extended to incorporate thedate(s) of these records. The customer account database is accessed andthe period(s) of the billing period during which the product wasactually subscribed to are determined. A central discount productdefinition database is also accessed that contains data defining theproduct. Any changes made to the product during the billing period areobtained. A time line data structure 700 is generated consisting of oneor more segment data structures 710-740. The time line data structure700 is preferably formed as a linked list of segments, each segmentrepresenting a part of the billing period during which the discountingproduct was subscribed to by the customer and during which the productwas not changed. A number of accumulator data structures, eachrepresented by a single data store 760-790, are linked to each segmentdata structure. In the example of FIG. 7a, the customer subscribes tothe product at point P1 generating segment 710, the discount rateapplicable to the discounting product is changed at point P2 generatingsegment 720, the customer changes options of the discounting product atpoint P3 generating segment 730, the customer cancels the subscriptionto the product at point P4 and resubscribes at point P5 generatingsegment 740.

Referring to FIG. 6, as each usage record is processed, a call type foreach usage record is determined in step 630 by cross-referencing its CTIwith the table mapping CTI to call type loaded into the system inprocess 100 from an external data store. There may be a number of CTIsmapped to a single call type, for example the CTIs for local, regional,national and international direct dialled calls may be mapped to thecall type direct dialled calls. The table also contains a flag for eachcall type indicating whether a call type for the destination number ofthe usage record should be determined. If the flag is set then step 630also determines a call type for the destination number of the usagerecord.

In step 640, for each discounting product in which each segment has anumber of accumulators, one for each call type, the date and time thecall was made or the service type used is checked against the segmentsof the time line. If the date and time falls within one of the segments,the charge of the usage record is added to the appropriate accumulatorfor that segment in step 650. For a discounting product such as Friends& Family each segment is divided into the numbers selected for Friends &Family, each of which will have an accumulator. In the step 660, theusage record is checked to determine if the call charge qualifies for aFriends & Family discount. If the number to which the call is made isone of the Friends & Family group, the call charge is added to theappropriate accumulator in step 670. Depending on the discountingproducts that are applicable to the customer, a call charge may be addedto a number of accumulators each associated with different products.Steps 630 to 670 occur in process 170, described with reference to FIG.2.

FIG. 7b expands on the example of FIG. 7a illustrating a number of usagerecords that qualify for the discounting product, the usage recordshaving respective dates D1-D5. Date D1 occurs prior to the start of thebilling period and the time line for the billing period is thereforeartificially expanded to include this date according to data in thecustomer account database and the discounting product definitiondatabase. From the data it is determined that the customer hadsubscribed to the discounting product during the period of date D1resulting in segment 750 and linked accumulator data structure 800 beinggenerated.

The date of each usage record is compared with the time line datastructure and if the date coincides with the period of one of thesegments, the charge held in the usage record is added to theaccumulator linked to that segment. In this example, the date D1coincides with the period of segment 750 and the charge of theassociated record is added to accumulator 800, and so on. The date D4does not coincide with the period of any segment and therefore thatusage record is not applicable for a discount from the discountingproduct and is ignored.

Referring again to FIG. 6, after all the usage records have beenprocessed discounts are calculated from the accumulated charges. For alldiscounting products other than Friends & Family, this is calculated bydetermining the call types that qualify for the discount product andapplying the correct discount rate to the sum stored in each accumulatorof qualifying call types in step 680. For Friends & Family, the amountof discount is determined in step 680 by applying the discount rateassociated with each of the customer's selected destination numbers tothe accumulated usage. In either case, for each discount calculated, adiscount record is generated in step 690 in which the discount and anyother details necessary to be displayed to the customer on their billare stored. Steps 680 to 690 occur in process 190, described withreference to FIG. 2.

Each discount record generated is then passed to process 150 to have aCTI and sort key assigned and to be added to the UBD. Process 170 isskipped when process 150 is called from process 190.

An example of a number of discount records passed to process 150 isshown below:

Field Rec 1 Rec 2 Rec 3 Option Number 90010 90010 90010 OptionDescription Super Saver Super Saver Super Saver Report start date19981220 19981220 19981220 Report end date 20000208 20000208 20000208Line start date 19981220 19990101 19981220 Line end date 1998123120000208 20000208 Call Type 102 102 104 Call Type Name Direct DirectNetwork Dialed Dialed Services Gross cost of call () 100.00 20.00 50.00Discount rate (%)  12.00 11.00  5.00 Discount amount ()  12.00  2.20 2.50

The hidden records relating to the discounting system added to theelectronic bill image by process 270 include a record for eachdiscounting product containing the data used to generate the product'srespective time line and a record for each product containing a copy ofeach segment and linked accumulator(s). For a product such as Friends &Family, the customer's chosen discounted numbers are also stored in ahidden record. Finally, a hidden record containing customer informationnot held elsewhere in the bill image is added to the bill image. Eachtype of hidden record has its own unique CTI assigned.

FIG. 8 is a flow chart of processes performed in disassembling andediting an existing bill image.

A bill image to be edited is disassembled into a number of records, eachrecord representing a particular entry in the bill image. These recordscan then be edited by a user through a menu interface. The editedrecords are then used by portions of the bill generation system of FIG.1 to reassemble the bill image reflecting any changes made by the user.

Each line of a bill image selected to be edited is processed to populatethe following data structures:

Control—holds data that appears on the bill once only including customeraddress, summary page totals, customer account number and bill serialnumber.

Details—holds usage records.

Installations—holds details of the installations that appear on a bill.Details include installation class (i.e. payphone, cardphone, businessetc) and number of lines for installation.

Discounting—holds details of all discounting products relating to theaccount.

Accounting—holds the total charge before discounts displayed on the billimage summary page.

The CTI field of each line is cross-referenced with a table givingmappings of CTIs to the relevant data structure(s) in step 800. Themappings associate each CTI with one of the above data structures andalso contain rules used to convert the data from the bill image lines tothe data structures. The mappings are used to export each line of thebill image to a record in the relevant data structure(s) in steps810-850.

An example of a record generated in the details data structure from adirect dialled call line in the bill image is as follows:

Field description Value Charge Type Identifier 35 Phone number of theinstallation 01232 12345 from which the call is made. Phone number ofthe line from 01232 12345 which the call is made Call chargeband (local,national, L international or other) Date call was made 1-Nov-1998 Timecall was made 18:03 The phone number of the 01232 84000 destinationbeing called The exchange name associated Belfast with the destinationbeing called the duration of the call  1:15 the number of call units 10associated with the call

The menu interface allows the records of the data structures to beedited in step 860. Using this interface, usage records can be altered,deleted or inserted; details of discounting products and dates on whichthey are subscribed to can be changed; and details of the customer andinstallation can be changed. Any change to the charge value of a usagerecord is reflected by an equivalent change to the total charge held inthe accounting data structure.

Once editing is complete, an option in the menu interface allows theuser to order the reassembly of the bill image from the data structuresin step 870.

FIG. 9 is the tree of FIG. 2 in which the processes used in reassemblingbill images are highlighted.

For each record of the details data structure, a usage record iscreated. The CTI and sort key held for each record is copied to theusage record. The usage records are then assembled into a UBD. Any newusage records inserted using the menu interface must have a CTI and sortkey assigned by being passed to processes 150-180.

The data contained in the discounting data structure is used in process130 to initialise discounting time lines and the total charge value heldin the accounting data structure is used to replace the call charge thatwould be accumulated by process 170. The UBD is then passed into thesystem at process 190 and a new bill image is generated for the amendedrecords according to processes 200-300.

What is claimed is:
 1. A method of generating a bill image for acustomer in a computer implemented billing system for atelecommunications network which includes discounts for a customerapplied to calls made during a billing period in which a plurality ofdiscount scheme apply, including: loading qualification criteria for thediscount schemes and customer account details into the billing system;generating a data structure for each discount scheme, the datastructures defining a time line over at least part of which the discountscheme was operative, the time line being divided in dependence onsubscription to the discount scheme by the customer and on changes tothe discount scheme during the billing period into a number of segmentseach of which corresponds to a period during which a respective versionof the discount scheme was operative; accumulating charges for the callsmade during each segment; and subsequently calculating an appropriatediscount from the accumulated charges for each segment for calls whichqualify for a discount under the said discount scheme; whereingenerating the time line further includes determining the date of theearliest made call of the calls made and, if the date falls before thestart of the billing period, extending the billing period to include thedate of the call.
 2. A method according to claim 1, wherein accumulatingthe charges for the calls made during each segment includes accumulatingthe charges for calls made in each of a number of predeterminedcategories.
 3. A method according to claim 2, characterised in that thecharges for the calls are accumulated by call type.
 4. A methodaccording to claim 2, characterised in that the charges for the callsare accumulated in dependence on the called number.
 5. A methodaccording to claim 2, characterised in that the step of calculating theappropriate discount includes obtaining an appropriate discount rateassociated with the respective version of the discount scheme for thepredetermined category for which the charges have been accumulated andapplying the discount rate to the accumulated charges.
 6. A methodaccording to claim 1, further including generating a discount usagerecord containing the calculated discount for use in the generation ofthe bill image.
 7. A computer implemented billing system characterisedin that the system is arranged to perform the following operations togenerate a bill image which includes discounts for a customer applied tocalls made during a billing period in which a plurality of discountscheme apply: generate a data structure for each discount schemedefining a time line over at least part of which the discount scheme wasoperative, the time line being divided in dependence on subscription tothe discount scheme by the customer and on changes to the discountscheme during the billing period into a number of segments each of whichcorresponds to a period during which a respective version of thediscount scheme wad operative, the time line including the date of theearliest made call of the calls made and, if the date falls before thestart of the billing period, extending the billing period to include thedate of the call accumulate charges for the calls made during eachsegment, and calculate an appropriate discount from the accumulatedcharges for each segment for calls which qualify for a discount underthe discount scheme.
 8. A method of generating a bill image for acustomer in a computer implemented billing system for atelecommunications network, the billing system being capable of applyinga plurality of discount schemes retrospectively at the end of a billingperiod, each discount scheme including a plurality of discounts whichapply to calls made during the billing period, the method including thesteps of, at a predetermined billing date: loading qualificationcriteria for each of said plurality of discount schemes and customeraccount details into the billing system; and for each of said pluralityof discount schemes for which the customer is determined to bequalified, generating a data structure which defines a time line over atleast part of which a said discount scheme was operative, the time linebeing divided in dependence on subscription to the said discount schemeby the customer and on changes to the said discount scheme during thebilling period into a number of segments, each segment corresponding toa period during which a respective version of the said discount schemewas operative, wherein the date of the earliest made call of the callsmade is determined and, if the date falls before the start of thebilling period, extending the billing period to include the date of thecall; accumulating charges for the calls made during each segment, andsubsequently calculating an appropriate discount from the accumulatedcharges for each segment for calls which qualify for a discount underthe said discount scheme.
 9. A method according to claim 8, whereinaccumulating the charges for the calls made during each segment includesaccumulating the charges for calls made in each of a number ofpredetermined categories.
 10. A method according to claim 9,characterised in that the charges for the calls are accumulated by calltype.
 11. A method according to claim 9, characterised in that thecharges for the calls are accumulated in dependence on the callednumber.
 12. A method according to claim 9, characterised in that thestep of calculating the appropriate discount includes obtaining anappropriate discount rate associated with the respective version of thediscount scheme for the predetermined category for which the chargeshave been accumulated and applying the discount rate to the accumulatedcharges.
 13. A method according to claim 8, further including generatinga discount usage record containing the calculated discount for use inthe generation of the bill image.